﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace NxChatQQ.Converters
{
    public class LoginBtnIsEnabledConverter : IMultiValueConverter
    {

        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values[0] is string input1 && values[1] is string input2 && values[2] is bool agree)
            {
                return agree && !string.IsNullOrWhiteSpace(input1) && !string.IsNullOrWhiteSpace(input2);
            }
            return false;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
